package com.coisini.design.pattern.creational.builder.imooc.v2;

/**
 * @Description 课程
 * @author coisini
 * @date Mar 5, 2022
 * @Version 1.0
 */
public class Course {

    private String courseName;
    private String coursePPT;
    private String courseVideo;
    private String courseArticle;
    private String courseQA;

    public Course(CourseBuilder courseBuilder) {
        this.courseName = courseBuilder.courseName;
        this.coursePPT = courseBuilder.coursePPT;
        this.courseVideo = courseBuilder.courseVideo;
        this.courseArticle = courseBuilder.courseArticle;
        this.courseQA = courseBuilder.courseQA;
    }

    @Override
    public String toString() {
        return "Course{" +
                "courseName='" + courseName + '\'' +
                ", coursePPT='" + coursePPT + '\'' +
                ", courseVideo='" + courseVideo + '\'' +
                ", courseArticle='" + courseArticle + '\'' +
                ", courseQA='" + courseQA + '\'' +
                '}';
    }

    public static class CourseBuilder {
       public String courseName;
       public String coursePPT;
       public String courseVideo;
       public String courseArticle;
       public String courseQA;

       public CourseBuilder builderCourseName(String courseName) {
           this.courseName = courseName;
           return this;
       }

       public CourseBuilder buildCoursePPT(String coursePPT) {
           this.coursePPT = coursePPT;
           return this;
       }

       public CourseBuilder buildCourseVideo(String courseVideo) {
           this.courseVideo = courseVideo;
           return this;
       }

       public CourseBuilder buildCourseArticle(String courseArticle) {
           this.courseArticle = courseArticle;
           return this;
       }

       public CourseBuilder buildCourseQA(String courseQA) {
           this.courseQA = courseQA;
           return this;
       }

       public Course build() {
            return new Course(this);
       }

   }

}
